﻿using Oliving.Edge.Model.Models.SystemBase;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Oliving.Edge.Model.Models
{
    /// <summary>
    /// 用户信息表
    /// </summary>
    [SugarTable("Sys_sysUserInfo")]
    //[SugarTable("Sys_sysUserInfo", "用户信息表")]
    public class sysUserInfo
    {
        public sysUserInfo() { }

        public sysUserInfo(string loginName, string loginPWD)
        {
            uLoginName = loginName;
            uLoginPWD = loginPWD;
            uRealName = uLoginName;
            uStatus = 0;
            uCreateTime = DateTime.Now;
            uUpdateTime = DateTime.Now;
            uLastErrTime = DateTime.Now;
            uErrorCount = 0;
            name = "";

        }
        /// <summary>
        /// 用户ID
        /// </summary>
        [SugarColumn(IsNullable = false, IsPrimaryKey = true, IsIdentity = true, ColumnDescription = " 用户ID ")]
        public int uID { get; set; }


        //[SugarColumn(IsNullable = true, ColumnDescription = " 修改时间 ")]
        //  , ColumnDescription = " 用户ID ")]


        /// <summary>
        /// 登录账号
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true, ColumnDescription = " 登录账号 ")]
        public string uLoginName { get; set; }
        /// <summary>
        /// 登录密码
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true, ColumnDescription = " 登录密码 ")]
        public string uLoginPWD { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true, ColumnDescription = " 真实姓名 ")]
        public string uRealName { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnDescription = " 状态 ")]
        public int uStatus { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = int.MaxValue, IsNullable = true, ColumnDescription = " 备注 ")]
        public string uRemark { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = " 创建时间 ")]
        public System.DateTime uCreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnDescription = " 更新时间 ")]
        public System.DateTime uUpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        ///最后登录时间 
        /// </summary>
        [SugarColumn(ColumnDescription = " 最后登录时间 ")]
        public DateTime uLastErrTime { get; set; } = DateTime.Now;

        /// <summary>
        ///错误次数 
        /// </summary>
        [SugarColumn(ColumnDescription = " 错误次数 ")]
        public int uErrorCount { get; set; }



        /// <summary>
        /// 登录账号
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true, ColumnDescription = " 登录账号 ")]
        public string name { get; set; }

        // 性别
        [SugarColumn(IsNullable = true, ColumnDescription = " 性别 ")]
        public int sex { get; set; } = 0;
        // 年龄
        [SugarColumn(IsNullable = true, ColumnDescription = " 年龄 ")]
        public int age { get; set; }
        // 生日
        [SugarColumn(IsNullable = true, ColumnDescription = " 生日 ")]
        public DateTime birth { get; set; } = DateTime.Now;
        // 地址
        [SugarColumn(ColumnDataType = "nvarchar", Length = 200, IsNullable = true, ColumnDescription = " 地址 ")]
        public string addr { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = " 地址 ")]
        public bool tdIsDelete { get; set; }


        [SugarColumn(IsIgnore = true)]
        public List<int> RIDs { get; set; }
        [SugarColumn(IsIgnore = true)]
        public List<string> RoleNames { get; set; }



        [SugarColumn(IsIgnore = true)]
        public string phone { get; set; }


        [SugarColumn(IsIgnore = true)]
        public string wechat { get; set; }

        /// <summary>
        ///  部门编号
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "部门编号")]
        public int DeptID { get; set; } = 0;


        [SugarColumn(IsIgnore = true)]
        public string SysDepartmentModelDeptName { get; set; }





    }
}
